package org.wishwork.api.stock.other;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.wishwork.api.stock.other.query.OtherInOutQueryApi;
import org.wishwork.api.stock.other.query.OtherInOutQueryRequest;
import org.wishwork.api.stock.other.query.response.OtherInOutQueryResponse;
import org.wishwork.api.stock.other.upload.OtherInOutUploadApi;
import org.wishwork.api.stock.other.upload.OtherInOutUploadResponse;
import org.wishwork.api.stock.other.upload.request.OtherInOutUploadRequest;
import org.wishwork.context.Context;

import java.util.List;

/**
 * @description: 其他出入库API
 * @author: WangYX
 * @create: 2022-04-12 14:01
 * @Version: 1.0.0
 **/

public class OtherInOutApi {

    private static final Logger log = LoggerFactory.getLogger(OtherInOutApi.class);

    private Context context;

    private OtherInOutQueryApi otherInOutQueryApi;

    private OtherInOutUploadApi otherInOutUploadApi;

    public OtherInOutApi(Context context) {
        this.context = context;
        this.otherInOutQueryApi = new OtherInOutQueryApi(context);
    }

    /**
     * 其它出入库查询
     *
     * @param otherInOutQueryRequest
     * @return
     * @throws Exception
     */
    public List<OtherInOutQueryResponse> query(OtherInOutQueryRequest otherInOutQueryRequest) throws Exception {
        return this.otherInOutQueryApi.business(otherInOutQueryRequest);
    }

    /**
     * 新建其它出入库（新）
     *
     * @param otherInOutUploadRequest
     * @return
     * @throws Exception
     */
    public OtherInOutUploadResponse upload(OtherInOutUploadRequest otherInOutUploadRequest) throws Exception {
        return this.otherInOutUploadApi.business(otherInOutUploadRequest);
    }


}
